<% if @user_stats.any? %>
  <div data-review-topic-users="true">

## <%= t('yearly_review.title.users_section', year: @review_year) %>
    <% @user_stats.each do |obj| %>
      <% if obj[:users] %>
## <%= t("yearly_review.title.#{obj[:key]}") %>

<div class="<%= class_from_key(obj[:key]) %>">

<%= table_header('user', "action.#{obj[:key]}") %>
|---|---|
          <% obj[:users].each_with_index do |user, i| %>
<%= table_row("#{avatar_image(user.username, user.uploaded_avatar_id)} @#{user.username}", format_number(user.action_count < 1 ? 1 : user.action_count.round)) %>
          <% end %>

</div>

        <% if obj[:key] == 'visits' %>
<%= raw(user_visits_link) %>
        <% end %>
      <% end %>
    <% end %>
  </div>
<% end %>

<% if @daily_visits.any? %>
  <div data-review-topic-users="true">

## <%= t("yearly_review.title.daily_visits") %>

<%= table_header("days_visited", "users") %>
|---|---|
      <% @daily_visits.each do |visit| %>
<%= table_row(format_number(visit.days), format_number(visit.users)) %>
      <% end %>

  </div>
<% end %>

<% if @featured_badge_users.any? %>
<div data-review-users="true">

## <%= t("yearly_review.title.featured_badge", badge_name: SiteSetting.yearly_review_featured_badge) %>

    <% @featured_badge_users.each do |user| %>
@<%= user.username %>
    <% end %>
    <% if @featured_badge_users[0].more_users > 0 %>
      <% @badge = @featured_badge_users[0] %>
<%= raw(badge_link(@badge.name, @badge.id, format_number(@badge.more_users))) %>
    <% end %>

</div>
<% end %>
